home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Clock / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  3.4 KB  |  113 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #define PART_H
  12.  
  13. // ----- Framework Layer -----
  14.  
  15. #ifndef FWPART_H
  16. #include "FWPart.h"
  17. #endif
  18.  
  19. // ----- OS Layer -----
  20.  
  21. #ifndef FWMNUITM_H
  22. #include "FWMnuItm.h"
  23. #endif
  24.  
  25. #ifndef FWTIME_H
  26. #include "FWTime.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. // Classes used by this interface
  31. //========================================================================================
  32.  
  33. class CClockContent;
  34.  
  35. //========================================================================================
  36. // Constants
  37. //========================================================================================
  38.  
  39. const short kAnalogClock = 1;
  40. const short kDigitalClock = 2;
  41.  
  42. //========================================================================================
  43. // CClockPart
  44. //========================================================================================
  45.  
  46. class CClockPart : public FW_CPart
  47. {
  48. public:
  49.     FW_DECLARE_AUTO(CClockPart)
  50.  
  51. //----------------------------------------------------------------------------------------
  52. //    Initialization/Destruction
  53. //
  54. public:
  55.     CClockPart(ODPart* odPart);
  56.     virtual void Initialize(Environment* ev, ODStorageUnit* storageUnit, FW_Boolean fromStorage);
  57.  
  58.     virtual ~ CClockPart();
  59.  
  60. //----------------------------------------------------------------------------------------
  61. //    Inherited API
  62. //
  63. public:
  64.     // ----- Factory Methods -----    
  65.     virtual FW_CFrame*         NewFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, FW_Boolean fromStorage);
  66.     virtual FW_CContent*     NewPartContent(Environment* ev);
  67.     
  68.     virtual FW_Handled        DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
  69.     
  70.     virtual FW_Handled         DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  71.     virtual FW_Handled         DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  72.     virtual FW_Handled         DoAbout(Environment* ev);
  73.     
  74. //----------------------------------------------------------------------------------------
  75. //    New API
  76. //
  77. public:    
  78.     void                     PlayTickSound();
  79.     void                     PlayChimeSound();
  80.     
  81.     void                    UseAnalogPresentation(Environment* ev, FW_Boolean analog);
  82.     FW_Boolean                UsesAnalogPresentation(Environment* ev) const;
  83.     
  84.     short                    Tick(Environment* ev, FW_CPresentation* presentation, const FW_CTime& currentTime);
  85.     void                    SynchContainingPartProperties(Environment* ev, FW_CPresentation* presentation);
  86.         
  87.     void                    SetClock(Environment* ev, long hourOffset, const FW_CString& faceString);
  88.  
  89. private:
  90.     void                    OpenClockSettingsDialog(Environment* ev);
  91.  
  92. //----------------------------------------------------------------------------------------
  93. //    Data Members
  94. //
  95. private:
  96.     FW_CTime             fLastTime;
  97.     CClockContent*        fClockContent;    
  98.     FW_Boolean            fLockIdle;            // Use to block idle while changing clock type    
  99.     FW_CIdler*            fIdler;
  100.     FW_Boolean            fUsesAnalog;
  101.     
  102.     FW_CPresentation*    fAnalogPresentation;    
  103.     FW_CPresentation*    fDigitalPresentation;    
  104.     FW_CPresentation*    fClockSettingsPresentation;    
  105.  
  106. #ifdef FW_BUILD_MAC
  107.     FW_PlatformHandle     fChimeSound;
  108.     FW_PlatformHandle     fTickSound;
  109. #endif
  110. };
  111.  
  112. #endif
  113.